package com.newsnetwork.api.controller.admin;

import com.newsnetwork.grace.result.CommonJSONResult;
import com.newsnetwork.pojo.bo.SaveCategoryBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.validation.Valid;

/**
 * @author: HuangDekai
 * @date: 2022/11/10 18:52
 * @version: 1.0
 * @since: jdk8
 * @description: 文章分类相关 API
 */
@Api(value = "文章分类维护", tags = {"文章分类维护的 Controller"})
@RequestMapping("categoryMng")
public interface CategoryMngControllerApi {

    @ApiOperation(value = "新增或者修改文章分类", notes = "新增或者修改文章分类", httpMethod = "POST")
    @PostMapping("/saveOrUpdateCategory")
    CommonJSONResult saveOrUpdateCategory(@RequestBody @Valid SaveCategoryBO saveCategoryBO);

    @ApiOperation(value = "查询文章分类列表", notes = "查询文章分类列表", httpMethod = "POST")
    @PostMapping("/getCatList")
    CommonJSONResult getCategoryList();

    @ApiOperation(value = "用户端查询分类列表", notes = "用户端查询分类列表", httpMethod = "GET")
    @GetMapping("getCats")
    CommonJSONResult getCats();
}
